#ifndef _INIT_H_
#define _INIT_H_

/*
Copyright (C) 2011 Salil Bhagurkar

This file is part of illusion

illusion is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

illusion is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with illusion.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <kernel/types.h>

extern struct vmmap kernel_vmmap;

void kernel_init();


static inline void divide_by_zero()
{
	int i = 1, j = 0;
	int x = i / j;
	(void)x;
}

/*
 * Kernel initialization states
 */
enum
{
	INIT_ZERO = 0,
	INIT_FAILED = 1,
	INIT_PROCESSOR = 2,
	INIT_CONSOLE = 3,
	INIT_PROCESSOR2 = 4,
	INIT_BITMAPS = 5,
	INIT_RESERVE_MODULE_MEM = 6,
	INIT_RESERVE_MEM = 7,
	INIT_MAP = 8,
	INIT_VFS = 9,
	INIT_REG_MODS = 10,
	INIT_RDISK = 11,
	INIT_TIMING = 12,
	INIT_KERNEL_DEVS = 13,
	INIT_CONSOLE_VFS = 14,
	INIT_POWER = 15,
	INIT_APIMOD = 16,
	INIT_SYS_VFS = 17,
	INIT_PAGE_SYS = 18,
	INIT_CONSOLE_SYS = 19,
	INIT_PROCESS = 20,
	INIT_SYSTEM = 21
};

extern struct kernel_module apimod_module;
extern struct vfs_node *apimod_module_fs;
extern struct vfs_node *ramdisk_root;

extern uint_t init_state;

#endif /* MEMORY_H_ */
